/**
 * OpportunitySource枚举
 *
 * @author sxf
 * @email sxf02615@163.com
 * @date 2025/1/15
 */
package com.sxf.crm.enums;


import java.util.Arrays;

/**
 * 商机状态枚举
 * 
 * <p>定义商机在不同阶段的状态</p>
 * 
 * @author sxf
 * @email sxf02615@163.com
 * @date 2025/6/1
 */
public enum OpportunitySource {
    /**
     * 线索
     */
    CLUE("CLUE", "线索"),

    /**
     * 商机
     */
    OPPORTUNITY("OPPORTUNITY", "商机");

    private final String code;
    private final String description;

    OpportunitySource(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static OpportunitySource fromValue(String value) {
        return Arrays.stream(OpportunitySource.values())
            .filter(resource -> resource.name().equals(value))
            .findFirst()
            .orElse(null);
    }
}